package com.bit.demo2;

import com.bit.demo1.Demo1;

class Animal{
    public Animal(int x){
        System.out.println("animal");
    }
    public void eat(){
        System.out.println("animal");
    }
}
class Cat extends Animal{
    public Cat(int x){
        super(x);
        System.out.println("cat");
    }
    public void eat(){
        System.out.println("cat");
    }
}
class Dog extends Animal{
    public Dog(int x){
        super(x);
        System.out.println("dog");
    }
    public void eat(){
        System.out.println("dog");
    }
}

public class Demo2 extends Demo1{
    public static void main(String[] args) {
        int x = 1;
        Animal animal0 = new Animal(x);
        //animal0.eat();
        Animal animal = new Cat(x);
        //animal.eat();
        Animal animal1 = new Dog(x);
        //animal1.eat();
    }

    /*public void ha(){
        Demo2 demo1 = new Demo2();
        System.out.println(demo1.v);
    }
    public static void main(String[] args) {

    }*/
}
